<?php

    	$table = "banner";

		$arr = explode("_", $table);
		$c = count($arr);
		$cl = "";
		for ($i = 0; $i < $c; $i++) {
			$cl .= ucfirst($arr[$i]);
		}

		$daoClass = $cl."Dao";
		BaseDao::includeOnceTarget("total/".$daoClass);

		$dao= new $daoClass($db_tot);
		$ret = $dao->selectStatement("desc " . $table);
		$desc = array();
		$cnt = count($ret);
		for ($i = 0; $i < $cnt; $i++) {
			$type = strpos($ret[$i]['Type'], 'int') !== false ? 'number' : 'text';
			$desc[$ret[$i]['Field']] =  array('type'=>$type);
		}
		//var_dump($desc);
		//end tao desc

		$dao = new $daoClass($db_tot);
		$dao->addSelect("*");
		//$dao->addLimit(9000, 3000);
		$list = $dao->select();
		//$conn = mysql_connect('localhost', 'root', '');
		//mysql_select_db('adppf', $conn);
		try {
			foreach ($list as $r) {
				$dao = new $daoClass($db_tot);
				foreach ($desc as $k => $inf) {
					if($inf['type'] == 'number') $dao->addColVal($k, $r[$k]);
					else $dao->addColValStr($k, $r[$k]);
				}
				try {
					$dao->insert(false, true);
				} catch (Exception $e) {
				}
				//$d = new AccountDao($db);
				//$d->insert();
				//$d->addSelect("");
			}
		} catch (Exception $e) {
		}